import { BasicFetchResult } from '../model/baseModel';
import { MessageBoardItem } from './model';
import { defHttp } from '/@/utils/http/axios';

enum Api {
  List = '/company/admin/content/listPage',
  Add = '/company/admin/product/add',
  Delete = '/company/admin/content/delete',
  Update = '/company/admin/product/update',
}

export const getList = (params: MessageBoardItem) =>
  defHttp.post<BasicFetchResult<MessageBoardItem>>({ url: Api.List, params });

export const addApi = (params: MessageBoardItem) =>
  defHttp.post<MessageBoardItem>({ url: Api.Add, params });

export const updateApi = (params: MessageBoardItem) =>
  defHttp.post<MessageBoardItem>({ url: Api.Update, params });

export const deleteApi = (params: { id: string }) => defHttp.get<any>({ url: Api.Delete, params });
